package com.movitech.mobile.cz.base.sys.mapper.ext;

import com.movitech.mobile.cz.base.sys.entity.SRegionalCompany;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.movitech.mobile.cz.base.sys.entity.ext.ExtSRegionalCompany;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 地区公司 Mapper 接口
 * </p>
 *
 * @author Movitech Mobile
 * @since 2018-02-28
 */
@Component
@Mapper
public interface ExtSRegionalCompanyMapper extends BaseMapper<SRegionalCompany> {

	String getRegionalCompanyNames(String[] regionalCompanyIdArr);

    /**
     * 判断是否是意向地区公司管理员
     * @param regionalCompanyIdArr
     * @param userId
     * @return
     */
    Integer checkMngUser(@Param("regionalCompanyIdArr")String[] regionalCompanyIdArr,@Param("userId")String userId);

    Integer findRegionalCompanyListCount(Map<String, Object> map);

    List<ExtSRegionalCompany> findRegionalCompanyList(Map<String, Object> map);

    List<ExtSRegionalCompany> getGroupRegionalCompany();

	SRegionalCompany getRegionalCompanyByMngUser(@Param("userId") String userId);

	List<String> getAdminCIdsBySupplierId(@Param("userId") String userId);

    SRegionalCompany selectByCode(String code);

    SRegionalCompany getRootRegionalCompany();
}
